-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WiP] Selecting multiple files for deleting on left menu #368
Conversation
guergana
commented
May 5, 2024
•
edited
Loading
edited
- fixes Problem selecting multiple files on the left menu #341
Deploying opendataeditor with Cloudflare Pages
|
9f0f583
to
2b23a80
Compare
return ( | ||
<InputDialog | ||
open={true} | ||
value={path} | ||
value={paths[0]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how moving file works. This might need to be reworked as well for multiple files
return ( | ||
<InputDialog | ||
open={true} | ||
value={path} | ||
value={paths[0]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as with moving files. This might need to be adjusted for multiSelection
for (const path of paths) { | ||
await client.fileDelete({ path }) | ||
onFileDelete(path) | ||
} | ||
}, | ||
moveFile: async (path, toPath) => { | ||
const { client, onFileCreate } = get() | ||
const result = await client.fileMove({ path, toPath, deduplicate: true }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how this works. haven't tested it yet
if (paths === newPaths) return | ||
set({ paths: newPaths }) | ||
if (!newPaths) return | ||
if (record?.path === newPaths[0]) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what this is doing. using only the first path just in case. Is it for the history? Do we need to modify the record to add all the selected paths?
if (selectors.isFolder(get())) return | ||
await openFile(newPath) | ||
// if more than one file is selected, display the only the first one | ||
if (paths && paths[0] !== newPaths[0]) await openFile(newPaths[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still not working 😅
@roll I need your help with this PR. I have some issues I can't figure out on my own, besides the fact that I am changing parts of the application in this ticket that I am not sure which side effects they could have.. I don't understand why here: https://github.com/okfn/opendataeditor/blob/main/client/components/Application/Content.tsx#L28 ? the FileContent is updated and fired even if the client and the record stay the same. If you test, when you select one File in the left menu it loads correctly, but when you select a second file, in theory, the FileContent component should stay the same, but it updates and returns a blank screen. Could you help me debug and test since you are the most familiar with all parts of the application? 🙏 |
@guergana
I think this kind of implementation at least won't break any existent functionality. WDYT? |
@roll I thought about doing something similar like |
@roll I am trying to implement your proposed approach but I think it will also complicate the logic. I can't find a way to implement this in a simple way. Would you mind taking over this task and implementing your proposed approach? |